package com.shop.loan.model;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.SQLDelete;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_erupt.Power;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.jpa.model.BaseModel;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Table(name = "s_user_address")
@Erupt(
        name = "用户收货地址",
        power = @Power(add = false, delete = false, viewDetails = false)

)
@SQLDelete(sql = "update s_user_address set is_delete = true, delete_time = now() where id = ?")
@Getter
@Setter
public class UserAddress extends BaseModel {



    @EruptField(
            views = @View(title = "省份"),
            edit = @Edit(
                    title = "省份"
            )
    )
    private String provinceName;


    @EruptField(
            views = @View(title = "城市"),
            edit = @Edit(
                    title = "城市"
            )
    )
    private String cityName;


    @EruptField(
            views = @View(title = "区/县"),
            edit = @Edit(
                    title = "区/县"
            )
    )
    private String countyName;


    @EruptField(
            views = @View(title = "省份"),
            edit = @Edit(
                    title = "省份"
            )
    )
    private String detailInfo;


    @EruptField(
            views = @View(title = "姓名"),
            edit = @Edit(
                    title = "姓名"
            )
    )
    private String userName;


    @EruptField(
            views = @View(title = "手机号码"),
            edit = @Edit(
                    title = "手机号码"
            )
    )
    private String userPhone;


    private Long rentalUserId;


    private Boolean isDelete = false;

    private Date deleteTime;
}
